export function add(a: number, b: number): number {
    return a + b;
}

export default function add2(a: number, b: number): number {
    return a + b+100;
}
export function add3(a: number, b: number): number {
    let a1=100;
    a1=a1+100;
    if(a1>0){
        let a1=200;
    }
    return a + b+a1;
}
export function add4(a: number, b: number) {
    const me={
        name:'zhangsan',
        age:20
    }
    me.age=me.age+10;
    return me;
}

export interface Person {
    name: string;
    age?: number;
}
export interface Pj{
    (source: string, subString: string): boolean;
}

export function add5(a: Person): Person {
    return a;
}

interface ClockInterface {
    currentTime: Date;
    show (d: Date):string;
}

export class Clock implements ClockInterface {
    currentTime: Date;
    constructor(h: number, m: number) {
        this.currentTime = new Date();
        this.currentTime.setHours(h);
        this.currentTime.setMinutes(m);
    }
     
    show(d: Date): string {
        return d.toString();
    }
}
interface Shape {
    color: string;
}
let square = <Shape>{};
square.color = "blue";

function greeter(person: Person) {
    return "Hello, " + person.name + "!";
}

abstract class Animal {
    abstract makeSound(): void;
    show(){
        console.log('show');
    }
}

let Greeter = (function () {
    function Greeter(message) {
        this.greeting = message;
    }
    Greeter.prototype.greet = function () {
        return "Hello, " + this.greeting;
    };
    return Greeter;
})();

let greeter;
greeter = new Greeter("world");
console.log(greeter.greet());

